<template>
  <div class="user-wrapper">
    <div class="user-title">
      <van-button
        class="btn-back"
        icon="arrow-left"
        :to="{ name: 'user' }" />
      {{ $t('User.feedback') }}
    </div>
    <div class="report-box">
      <h2 class="report-title">{{ $t('User.feedback_title') }}</h2>
      <van-field type="textarea" v-model="feedback" :placeholder="$t('User.feedback_tip')" />
      <van-button
        class="block-btn"
        @click="toFeedback"
        block>{{ $t('User.submit') }}</van-button>
    </div>
    <div class="report-box">
      <h2 class="report-title">{{ $t('User.business_cooperation') }}</h2>
      <div class="partner-info">{{ $t('User.email') }}<br>{{ $t('User.offical_wx') }}</div>
      <p class="primary">{{ $t('User.follow_us') }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userId: '',
      feedback: '',
    };
  },
  methods: {
    async toFeedback() {
      const { code, message } = await this.$API.user.feedBack({
        data: {
          userId: this.userId,
          contentext: this.feedback,
        }
      });

      if (code === 0) {
        this.$toast(message);
      }
    },
  }
};
</script>

<style lang="less" scoped>
  .report-box{
    padding: 30px 40px;
    margin-bottom: 20px;
    background: #fff;
    line-height:48px;
    font-size:@font-size-sm;
    color: #333;
  }
  .report-title{
    font-size: @font-size-lg;
    font-weight:bold;
    margin-bottom:20px;
  }
  .van-field--min-height{
    border-radius:12px;
    background: #f6f6f6;
    & /deep/ .van-field__control{
      min-height: 540px;
      padding: 20px;
    }
  }
  .block-btn{
    width: 570px;
    margin: 40px auto 0;
  }
  .primary{
    font-size:26px;
    color:#999;
  }
</style>
